package com.woniu.platform.contorller;

import com.woniu.platform.entity.PlatformUser;
import com.woniu.platform.service.PlatformUserService;
import com.woniu.util.utils.HttpResult;
import com.woniu.util.utils.RequestResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("user")
public class PlatformUserController {
    @Autowired
    private PlatformUserService platformUserService;

    /**
     * 分页查询用户信息
     * @param requestResult
     * @return
     */
    @PostMapping("queryuser")
    public HttpResult queryPlatformUserInfo(@RequestBody RequestResult<PlatformUser> requestResult){
        return platformUserService.queryPlatformUserInfo(requestResult);
    }

    /**
     * 修改用户信息
     * @param platformUser
     * @return
     */
    @PostMapping("changeuser")
    public HttpResult changeUserInfo(@RequestBody PlatformUser platformUser){
        return platformUserService.changeUserInfo(platformUser);
    }

    /**
     * 添加用户
     * @param platformUser
     * @return
     */
    @PostMapping("adduser")
    public HttpResult insertUserInform(@RequestBody PlatformUser platformUser){
        return platformUserService.insertUserInfo(platformUser);
    }

}
